<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>登录</title>
    <!--bootstrap-->
    <link href="__STATIC__/pc/css/bootstrap.css" rel="stylesheet">
    <link href="__STATIC__/pc/css/bootstrap-theme.css" rel="stylesheet">
    
    <!--css-->
    <link href="__STATIC__/pc/css/global.css" rel="stylesheet">
    <link href="__STATIC__/pc/css/style.css" rel="stylesheet">
    <link href="__STATIC__/pc/css/logo.css" rel="stylesheet">
    <link rel="stylesheet" type="text/css" href="__STATIC__/pc/css/setdiv.css">
    <script src="__STATIC__/pc/js/jquery.js"></script>
    <script src="__STATIC__/layer/layer.js"></script>
    <style>
        input[type=text], textarea {
            border: none;
        }
        .login{color: #fead15;}
        .testsection{
        	margin-right: auto; 
    		margin-left: auto; 
        }
        .aui-content-box{
    width: 666px;
    margin: -354px auto 138px;
    //margin-left: 628px;
    padding: 70px 65px 0 75px;
    background-color: #ffff;
    display: table;
    border-radius: 1px;
    border: 1px solid #d6d6d6;
    z-index: 1;
    position: relative;

}
    </style>
    <script>
        $(document).ready(function() {

            $(".yzm").click(function(){
                if( $(this).attr("src").indexOf('?')>0){
                    $(this).attr("src", $(this).attr("src")+'&random='+Math.random());
                }else{
                    $(this).attr("src", $(this).attr("src").replace(/\?.*$/,'')+'?'+Math.random());
                }
            });

            $(".regsist").click(function(){
                $("#_login").hide();
                $("#_reg").show();
            });
            $(".login").click(function(){
                $("#_login").show();
                $("#_reg").hide();
            });
        });
    </script>
</head>
<body>
    <header class="aui-header">
        <div class="aui-header-box">
            <img src="__STATIC__/uploads/{$web_set_result['logo']}" style="width: 180px;margin-left: auto;margin-right: auto;">
            <p class="ch_ad"><span class="ad"></span><span>一站式中小微企业政策服务平台</span><span class="ad"></span></p>
        </div>
    </header>
    <!--
    	作者：offline
    	时间：2018-05-21
    	描述：
    -->
    <section id="_login" class="aui-content testsection" <if condition="$is_register neq 0">style="display:none ;"</if>>
        <div class="aui-content-box clearfix">
            <div class="aui-content-box-fl" style="margin: 0 auto;height: 50px;">
                <h2>欢迎登录</h2>
                <!--<p class="weclome">某某公司查询软件</p>-->
            </div>
            <div class="DeInfoInput LoginInput">
                <label class="loginsmall"></label>
                <input type="text" placeholder="请输入账号" class="DeInfo_text"  value="" name="account" id="account">
            </div>
            <div class="DeInfoInput LoginInput line">
                <label class="loginsmall"></label>
                <input type="password" placeholder="请输入密码" class="DeInfo_text"  value="" name="passwd" id="passwd" >
            </div>
            <div class="DeInfoInput LoginInput line">
                <label class="loginsmall"></label>
                <input type="text" placeholder="验证码" class="DeInfo_text" maxlength="5" name="verifyCode" class="login_txtbx" id="verifyCode">
                <img src="/admin/Login/captchaImg" alt="captcha" class="yzm"  title="换一张" style="width:147px;float:right; display:block; cursor:pointer;" />
            </div>
            <div class="password">
                <!--<div class="remember_box">-->
                     <!--<input class="remember" name="" value="" type="checkbox"/>-->
                    <!--<p><span>请输入手机号码</span><span class="fence"></span></p>-->

                <!--</div>-->

                <!--<p class="forget">忘记密码？</p>-->
            </div>
            <div class="BtnCont">
                <button class="BigBtn btn_login">登录</button>
            </div>
            <br />
             <div class="BtnCont">
                <button class="BigBtn " onclick="window.history.go(-1);">返回</button>
            </div>
            <div class="tips">
                <p><span class="doesnt">没有账号?</span>
                    <span class="regsist">立即注册</span></p>
            </div>
        </div>
    </section>
    <section id="_reg" class="aui-content" <if condition="$is_register neq 1">style="display:none;</if>">
        <div class="aui-content-box clearfix">
            <div class="aui-content-box-fl"  style="margin: 0 auto;height: 50px;">
                <h2>欢迎注册</h2>
                <!--<p class="weclome">某某公司查询软件</p>-->
            </div>
            <div class="DeInfoInput LoginInput">
                <label class="loginsmall"></label>
                <input type="text" placeholder="请输入账号" class="DeInfo_text"  value="" name="account2" id="account2">
            </div>
            <div class="DeInfoInput LoginInput">
                <label class="loginsmall"></label>
                <input type="text" placeholder="请输入真实姓名" class="DeInfo_text"  value="" name="account3" id="account3">
            </div>
            <div class="DeInfoInput LoginInput">
                <label class="loginsmall"></label>
                <input type="text" placeholder="请输入公司名" class="DeInfo_text"  value="" name="company" id="company">
            </div>
            <div class="DeInfoInput LoginInput">
                <label class="loginsmall"></label>
                <input type="text" placeholder="请输入手机号码" class="DeInfo_text"  value="" name="mobile" id="mobile">
            </div>
            <div class="DeInfoInput LoginInput line">
                <label class="loginsmall"></label>
                <input type="text" placeholder="验证码" class="DeInfo_text" maxlength="5" name="verifyCode2" class="login_txtbx" id="verifyCode2">
                <img src="/admin/Login/captchaImg" alt="captcha" class="yzm"  title="换一张" style="width:147px;float:right; display:block; cursor:pointer;" />
            </div>
            <!--<div class="DeInfoInput LoginInput line">-->
                <!--<input type="password" placeholder="请输入验证码" class="DeInfo_text"  style="width:70%;" value="" name="" >-->
                <!--<span class="geline"></span>-->
                <!--<button>获取验证码</button>-->
            <!--</div>-->

            <div class="DeInfoInput LoginInput line">
                <label class="loginsmall"></label>
                <input type="password" placeholder="请输入密码" class="DeInfo_text"  value="" name="passwd2" id="passwd2" >
            </div>

            <div class="password">
                    <!--<p><span>点击注册，即表示您已经阅读并同意</span>-->
                        <!--<span class="fence" style="color:#fead15;margin-left: 12px;">用户协议</span>-->
                    <!--</p>-->

                    <!--<p>密码至少含8位数字</p>-->
                <!--<p class="forget"></p>-->
            </div>
            <div class="BtnCont">
                <button class="BigBtn btn_reg">注册</button>
            </div>
            
            <br />
             <div class="BtnCont">
                <button class="BigBtn " onclick="window.history.go(-1);">返回</button>
            </div>
            
            <div class="tips">
                <p><span class="doesnt">已经账号！</span>
                    <span class="login">立即登录</span></p>
            </div>
        </div>
    </section>
    <div class="bottomimg">
        <img src="__STATIC__/pc/img/bottombg.png">
    </div>
    <script>
        $('.btn_login').click(function (event) {
            if($("#account").val()==""){
                layer.alert("账号不能为空!");
                return false;
            }

            if($("#passwd").val()==""){
                layer.alert("密码不能为空!");
                return false;
            }

            if($("#verifyCode").val()==""){
                layer.alert("验证码不能为空!");
                return false;
            }
            var account = $("input[name='account']").val();
//            var mobile = $("input[name='mobile']").val();
            var passwd = $("input[name='passwd']").val();
            var verifyCode = $("input[name='verifyCode']").val();

            $.post("{:url('Login/login_do')}",{account:account,passwd:passwd,verifyCode:verifyCode},function(result){
                if(result.code == '0'){
                    layer.alert(result.msg);
                }else{
                    layer.alert(result.msg, {
                                btn: ['确定']
                            },
                            function (index, item) {
                                location.href = result.url;
                            });
                }
            });

            return false;
        });
        $('.btn_reg').click(function (event) {
            if($("#account2").val()==""){
                layer.alert("账号不能为空!");
                return false;
            }
            if($("#account3").val()==""){
                layer.alert("姓名不能为空!");
                return false;
            }
            if($("#company").val()==""){
                layer.alert("账号不能为空!");
                return false;
            }
            if($("#mobile").val()==""){
                layer.alert("手机号码不能为空!");
                return false;
            }

            if($("#verifyCode2").val()==""){
                layer.alert("验证码不能为空!");
                return false;
            }

            if($("#passwd2").val()==""){
                layer.alert("密码不能为空!");
                return false;
            }
            var account = $("input[name='account2']").val();
            var account3 = $("input[name='account3']").val();
            var passwd = $("input[name='passwd2']").val();
            var company = $("input[name='company']").val();
            var mobile = $("input[name='mobile']").val();
            var verifyCode = $("input[name='verifyCode2']").val();

            $.post("{:url('Login/register')}",{account:account,account3:account3,company:company,mobile:mobile,passwd:passwd,verifyCode:verifyCode},function(result){
                if(result.code == '0'){
                    layer.alert(result.msg);
                }else{
                    layer.alert(result.msg, {
                                btn: ['确定']
                            },
                            function (index, item) {
                                location.href = result.url;
                            });
                }
            });

            return false;
        });

    </script>
</body>
</html>